package com.tanhua.server.controller;

import com.tanhua.server.service.TanHuaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 探花功能(左滑不喜欢右滑喜欢)
 */
@RestController
@RequestMapping("/tanhua")
@Slf4j
public class TanHuaController {

    @Autowired
    private TanHuaService tanHuaService;

    /**
     * 接口名称：探花-左滑右滑
     * 接口路径：GET/tanhua/cards
     */
    @GetMapping("/cards")
    public ResponseEntity<Object> tanHuaFindByRecommendUser() {
        log.info("接口名称：探花-左滑右滑");
        return tanHuaService.tanHuaFindByRecommendUser();
    }

    /**
     * 接口名称：探花-不喜欢
     * 接口路径：GET/tanhua/:id/unlove
     */
    @GetMapping("{id}/unlove")
    public ResponseEntity<Object> tanHuaUnLove(@PathVariable("id") Long recommendUserId) {
        log.info("探花-不喜欢");
        return tanHuaService.tanHuaUnLove(recommendUserId);
    }

    /**
     * 接口名称：探花-喜欢
     * 接口路径：GET/tanhua/:id/love
     */
    @GetMapping("{id}/love")
    public ResponseEntity<Object> tanHuaLove(@PathVariable("id") Long recommendUserId) {
        log.info("接口名称：探花-喜欢");
        return tanHuaService.tanHuaLove(recommendUserId);
    }

}
